#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableUnionBatterySuitDao:DaoBase<TableUnionBatterySuit>
    {
        public override string GetFileName()
        {
            return "TableUnionBatterySuit.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableUnionBatterySuit>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableUnionBatterySuit model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.suitId)) UnityEngine.Debug.LogError("数据表id重复:TableUnionBatterySuit->id: " + model.suitId);
            #endif
            cachePrimaryInt[model.suitId] = model;
        }
        protected override TableUnionBatterySuit ParseRowData(string[] rowData)
        {
            TableUnionBatterySuit data = new TableUnionBatterySuit();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.suitId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.batteryId = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.suitName = rowData[2];
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.suitResource = rowData[3];
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.buyCost = rowData[4];
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.unionFightPorpAdd = rowData[5];
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.unionFightPropPerAdd = rowData[6];
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.unionSeaFightPorpAdd = rowData[7];
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.unionSeaFightPropPerAdd = rowData[8];
            }
            if (!string.IsNullOrEmpty(rowData[9]))
            {
                data.addPropDesc = rowData[9];
            }
            return data;
        }
    }
}
